/******************************************************************************* 
 * Copyright (C) 2012-2015 Microfountain Technology, Inc. All Rights Reserved. 
 * 
 * Unauthorized copying of this file, via any medium is strictly prohibited.   
 * Proprietary and confidential
 * 
 * Last Modified: 2015-11-25 13:53:47
 ******************************************************************************/
package cn.com.xy.sms.util;

import java.util.HashMap;
import java.util.Map;

import android.content.Context;
import cn.com.xy.sms.sdk.constant.Constant;
import cn.com.xy.sms.sdk.dex.DexUtil;
import cn.com.xy.sms.sdk.net.util.SigntureUtil;
import cn.com.xy.sms.sdk.util.PopupUtil;

public class ParseRemindManager {

    public static Map<String, Object> parseRemindMsg(Context ctx, String phoneNumber, String smsCenterNum, String smsContent, Map<String, String> extend) throws Exception {
        if (ctx == null) {
            throw new Exception(" Context is null.");
        }

        if (phoneNumber == null) {
            throw new Exception(" phoneNumber is null.");
        }
        if (smsContent == null) {
            throw new Exception(" smsContent is null.");
        }
        if (!SigntureUtil.checkChannelFuncPower(Constant.POWER_TO_REMIND))
            PopupUtil.getResultMap(false, false);
        Map<String, Object> res = ParseManager.parseMsg(ctx, phoneNumber, smsCenterNum, smsContent, 0l, extend);
        Map<String, Object> map = null;
        if (res != null && ParseBubbleManager.getParseStatu(res) != -1) {
            map = DexUtil.handerRemindValueMap(res);
            if (map == null) {
                map = new HashMap<String, Object>();
                map.put("Result", false);
                return map;
            }
            map.put("Result", true);
            return map;
        } else {
            map = new HashMap<String, Object>();
            map.put("Result", false);
            return map;
        }

    }
}
